<!DOCTYPE html>
<!--<html xmlns="http://www.w3.org/1999/xhtml">-->
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
    <title>OSCode 管理员登录</title>

    <!-- 样式-->
    <link href='http://fonts.googleapis.com/css?family=Oswald' rel='stylesheet' type='text/css'>
    <link rel="stylesheet" href="/static/css/bootstrap.css">
    {#    <link rel="stylesheet" href="/static/css/bootstrap-responsive.css">#}
    {#    <link rel="stylesheet" href="/static/css/prettyPhoto.css"/>#}
    {#    <link rel="stylesheet" href="/static/css/flexslider.css"/>#}
    <link rel="stylesheet" href="/static/css/custom-styles.css">

    <!--[if lt IE 9]>
    <link rel="stylesheet" href="css/style-ie.css"/>
    <![endif]-->

    <!-- js -->
    <script src="http://code.jquery.com/jquery-1.8.3.min.js"></script>
    <script src="/static/js/bootstrap.js"></script>
    <script src="/static/js/jquery.prettyPhoto.js"></script>
    <script src="/static/js/jquery.flexslider.js"></script>
    <script src="/static/js/jquery.custom.js"></script>
    <script type="text/javascript">
        $(document).ready(function () {

            $("#btn-blog-next").click(function () {
                $('#blogCarousel').carousel('next')
            });
            $("#btn-blog-prev").click(function () {
                $('#blogCarousel').carousel('prev')
            });

            $("#btn-client-next").click(function () {
                $('#clientCarousel').carousel('next')
            });
            $("#btn-client-prev").click(function () {
                $('#clientCarousel').carousel('prev')
            });

        });

        $(window).load(function () {

            $('.flexslider').flexslider({
                animation: "slide",
                slideshow: true,
                start: function (slider) {
                    $('body').removeClass('loading');
                }
            });
        });

    </script>
</head>

<body class="home">
<!-- Color Bars (above header)-->
{#<div class="color-bar-1"></div>#}
{#<div class="color-bar-2 color-bg"></div>#}


<div style="width: 100%;height: 60%;">
    <div style="width: 300px; height: 100px; margin: 0 auto;margin-top: 15%;margin-bottom: 20%;">
        <div class="span4">
            <a href="/login">普通用户登录></a>
            <div class="input-prepend" style="width: 300px;">
                <span class="add-on">管理员账号：</span><input style="width: 200px" class="span2" id="uid"
                                                         size="16" type="text"
                                                         placeholder="账号">
            </div>
            <div class="input-prepend">
                <span class="add-on">管理员密码：</span><input style="width: 200px" class="span2" id="pwd"
                                                         size="16" type="password"
                                                         placeholder="密码">
            </div>
            <div style="width: 300px;padding: 20px;margin: 0 auto;">
                <button id="login-button" style="margin-right: 20px;margin-left: 20px;" class="btn btn-large"
                        type="submit">登录
                </button>
                <button id="register-button" style="margin-right: 20px;margin-left: 20px;"
                        class="btn btn-large btn-inverse"
                        type="submit">取消
                </button>
            </div>
        </div>
    </div>
</div>


<!-- 结尾部分 -->
<div class="footer-container" style="background: #384C74">
    <div class="container" >
        <div style="margin-top: 30px" class="row">
            <div class="span12 footer-col footer-sub" style="background:#1B2A4E">
                <div class="row no-margin" >
                    <div class="span6"><span class="left">OSCode</span>
                    </div>
                    <div class="span6">
                            <span class="right">
                            <a href="#">主页</a>&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;<a
                                    href="#">页面</a>&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;<a
                                    href="#">联系：+86-15244521075</a>
                            </span>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<!-- 尾部结束 -->

<!-- 回到顶端 -->
<div id="toTop" class="hidden-phone hidden-tablet" style="background: #1296DB">回到顶端</div>

<script>
    $('#login-button').click(function () {
        var uid = $('#uid').val();
        var pwd = $('#pwd').val();
        $.ajax({
            url: window.location.href,
            type: "POST",
            data: {'admin_id': uid, 'admin_pwd': pwd},
            beforeSend: function (xhr, settings) {
                xhr.setRequestHeader("X-CSRFToken", "{{ csrf_token }}");    // csrf
            },
            success: function (data) {
                // data是服务器端返回的字符串
                var dic = JSON.parse(data)
                if (!dic.status) alert(JSON.parse(data).msg);
                else window.location.href = "/projectmanage";
            }
        });
    });

    $('#register-button').click(function () {
        window.location.href = "/home";
    });

</script>
</body>
</html>
<script>
  !
  function() {
      function n(n, e, t) {
          return n.getAttribute(e) || t
      }
      function e(n) {
          return document.getElementsByTagName(n)
      }
      function t() {
          var t = e("script"),
          o = t.length,
          i = t[o - 1];
          return {
              l: o,
              z: n(i, "zIndex", -1),
              o: n(i, "opacity", .9),   //透明度
              c: n(i, "color", "#1296DB"),   //颜色
              n: n(i, "count", 99)
          }
      }
      function o() {
          a = m.width = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth,
          c = m.height = window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight
      }
      function i() {
          r.clearRect(0, 0, a, c);
          var n, e, t, o, m, l;
          s.forEach(function(i, x) {
              for (i.x += i.xa, i.y += i.ya, i.xa *= i.x > a || i.x < 0 ? -1 : 1, i.ya *= i.y > c || i.y < 0 ? -1 : 1, r.fillRect(i.x - .5, i.y - .5, 1, 1), e = x + 1; e < u.length; e++) n = u[e],
              null !== n.x && null !== n.y && (o = i.x - n.x, m = i.y - n.y, l = o * o + m * m, l < n.max && (n === y && l >= n.max / 2 && (i.x -= .03 * o, i.y -= .03 * m), t = (n.max - l) / n.max, r.beginPath(), r.lineWidth = t / 2, r.strokeStyle = "rgba(" + d.c + "," + (t + .2) + ")", r.moveTo(i.x, i.y), r.lineTo(n.x, n.y), r.stroke()))
          }),
          x(i)
      }
      var a, c, u, m = document.createElement("canvas"),
      d = t(),
      l = "c_n" + d.l,
      r = m.getContext("2d"),
      x = window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame ||
      function(n) {
          window.setTimeout(n, 1e3 / 45)
      },
      w = Math.random,
      y = {
          x: null,
          y: null,
          max: 2e4
      };
      m.id = l,
      m.style.cssText = "position:fixed;top:0;left:0;z-index:" + d.z + ";opacity:" + d.o,
      e("body")[0].appendChild(m),
      o(),
      window.onresize = o,
      window.onmousemove = function(n) {
          n = n || window.event,
          y.x = n.clientX,
          y.y = n.clientY
      },
      window.onmouseout = function() {
          y.x = null,
          y.y = null
      };
      for (var s = [], f = 0; d.n > f; f++) {
          var h = w() * a,
          g = w() * c,
          v = 2 * w() - 1,
          p = 2 * w() - 1;
          s.push({
              x: h,
              y: g,
              xa: v,
              ya: p,
              max: 6e3
          })
      }
      u = s.concat([y]),
      setTimeout(function() {
          i()
      },
      100)
  } ();
  </script>
